{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 投资参考数据\n",
    "\n",
    "投资参考提供一些可能会影响股票价格走势的信息数据，为投资者在做投资决策时提供数据参考，亦可作为量化策略模型的事件因子纳入模型的计算。TuShare提供的参考数据主要包括以下：\n",
    "\n",
    "    分配预案\n",
    "    业绩预告\n",
    "    限售股解禁\n",
    "    基金持股\n",
    "    新股上市\n",
    "    融资融券（沪市）\n",
    "    融资融券（深市）\n",
    "\n",
    "分配预案\n",
    "\n",
    "每到季报、年报公布的时段，就经常会有上市公司利润分配预案发布，而一些高送转高分红的股票往往会成为市场炒作的热点。及时获取和统计高送转预案的股票是参与热点炒作的关键，TuShare提供了简洁的接口，能返回股票的送转和分红预案情况。\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    year : 预案公布的年份，默认为2014\n",
    "    top :取最新n条数据，默认取最近公布的25条\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    code:股票代码\n",
    "    name:股票名称\n",
    "    year:分配年份\n",
    "    report_date:公布日期\n",
    "    divi:分红金额（每10股）\n",
    "    shares:转增和送股数（每10股）\n",
    "\n",
    "调用方法：\n",
    "```\n",
    "import tushare as ts\n",
    "\n",
    "df = ts.profit_data(top=60)\n",
    "df.sort('shares',ascending=False)\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 分配预案"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Getting data:]##"
     ]
    }
   ],
   "source": [
    "import tushare as ts\n",
    "\n",
    "df = ts.profit_data(top=60)\n",
    "df = df.sort_values('shares',ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "60"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>code</th>\n",
       "      <th>name</th>\n",
       "      <th>year</th>\n",
       "      <th>report_date</th>\n",
       "      <th>divi</th>\n",
       "      <th>shares</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>300482</td>\n",
       "      <td>万孚生物</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>002647</td>\n",
       "      <td>民盛金科</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>002124</td>\n",
       "      <td>天邦股份</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>603358</td>\n",
       "      <td>华达科技</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>6.8</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>603232</td>\n",
       "      <td>格尔软件</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>603519</td>\n",
       "      <td>立霸股份</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>4.5</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>601139</td>\n",
       "      <td>深圳燃气</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603633</td>\n",
       "      <td>徕木股份</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>1.3</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>600984</td>\n",
       "      <td>建设机械</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>603203</td>\n",
       "      <td>快克股份</td>\n",
       "      <td>2017</td>\n",
       "      <td>2018-04-28</td>\n",
       "      <td>3.3</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      code  name  year report_date  divi  shares\n",
       "8   300482  万孚生物  2017  2018-04-28   5.0     8.0\n",
       "39  002647  民盛金科  2017  2018-04-28   0.0     5.0\n",
       "43  002124  天邦股份  2017  2018-04-28   1.0     5.0\n",
       "5   603358  华达科技  2017  2018-04-28   6.8     4.0\n",
       "49  603232  格尔软件  2017  2018-04-28   4.0     4.0\n",
       "13  603519  立霸股份  2017  2018-04-28   4.5     4.0\n",
       "40  601139  深圳燃气  2017  2018-04-28   1.5     3.0\n",
       "4   603633  徕木股份  2017  2018-04-28   1.3     3.0\n",
       "53  600984  建设机械  2017  2018-04-28   0.0     3.0\n",
       "25  603203  快克股份  2017  2018-04-28   3.3     3.0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 业绩预告"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "按年度、季度获取业绩预告数据，接口提供从1998年以后每年的业绩预告数据，需指定年度、季度两个参数。数据在获取的过程中，会打印进度信息(下同)。\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    year:int 年度 e.g:2014\n",
    "    quarter:int 季度 :1、2、3、4，只能输入这4个季度\n",
    "\n",
    "结果返回的数据属性说明如下：\n",
    "\n",
    "code,代码\n",
    "name,名称\n",
    "type,业绩变动类型【预增、预亏等】\n",
    "report_date,发布日期\n",
    "pre_eps,上年同期每股收益\n",
    "range,业绩变动范围\n",
    "\n",
    "调用方法：\n",
    "\n",
    "#获取2014年中报的业绩预告数据\n",
    "ts.forecast_data(2014,2)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Getting data:]###########################################"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>code</th>\n",
       "      <th>name</th>\n",
       "      <th>type</th>\n",
       "      <th>report_date</th>\n",
       "      <th>pre_eps</th>\n",
       "      <th>range</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>601968</td>\n",
       "      <td>宝钢包装</td>\n",
       "      <td>预盈</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>-0.0300</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>601878</td>\n",
       "      <td>浙商证券</td>\n",
       "      <td>预降</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.1800</td>\n",
       "      <td>-23.97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002262</td>\n",
       "      <td>恩华药业</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.2073</td>\n",
       "      <td>25.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>600794</td>\n",
       "      <td>保税科技</td>\n",
       "      <td>预盈</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>-0.0717</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002116</td>\n",
       "      <td>中国海诚</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.2100</td>\n",
       "      <td>11.08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>000598</td>\n",
       "      <td>兴蓉环境</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.1500</td>\n",
       "      <td>17.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>002080</td>\n",
       "      <td>中材科技</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.4630</td>\n",
       "      <td>2.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>002028</td>\n",
       "      <td>思源电气</td>\n",
       "      <td>预降</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.1900</td>\n",
       "      <td>-8.12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>000550</td>\n",
       "      <td>江铃汽车</td>\n",
       "      <td>预降</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.6400</td>\n",
       "      <td>-42.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>002605</td>\n",
       "      <td>姚记扑克</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.0899</td>\n",
       "      <td>24.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>601718</td>\n",
       "      <td>际华集团</td>\n",
       "      <td>预减</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.1300</td>\n",
       "      <td>-68.53%~-53.87%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002235</td>\n",
       "      <td>安妮股份</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.0910</td>\n",
       "      <td>29.98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>603227</td>\n",
       "      <td>雪峰科技</td>\n",
       "      <td>预盈</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>-0.0040</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>600410</td>\n",
       "      <td>华胜天成</td>\n",
       "      <td>预减</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.1400</td>\n",
       "      <td>-92.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>002142</td>\n",
       "      <td>宁波银行</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.9400</td>\n",
       "      <td>19.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>000058</td>\n",
       "      <td>深赛格</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.0405</td>\n",
       "      <td>95.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>600558</td>\n",
       "      <td>大西洋</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.0250</td>\n",
       "      <td>90%~110%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>002287</td>\n",
       "      <td>奇正藏药</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-26</td>\n",
       "      <td>0.4179</td>\n",
       "      <td>12.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>600578</td>\n",
       "      <td>京能电力</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.0100</td>\n",
       "      <td>380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>000049</td>\n",
       "      <td>德赛电池</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.5578</td>\n",
       "      <td>16.49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>002030</td>\n",
       "      <td>达安基因</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.0800</td>\n",
       "      <td>2.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>002083</td>\n",
       "      <td>孚日股份</td>\n",
       "      <td>预降</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.2684</td>\n",
       "      <td>-20.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>603416</td>\n",
       "      <td>信捷电气</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.4600</td>\n",
       "      <td>5.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>600183</td>\n",
       "      <td>生益科技</td>\n",
       "      <td>预降</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.3700</td>\n",
       "      <td>-1.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>600028</td>\n",
       "      <td>中国石化</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.2240</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>603368</td>\n",
       "      <td>柳药股份</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>1.2800</td>\n",
       "      <td>33.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002795</td>\n",
       "      <td>永和智控</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.2600</td>\n",
       "      <td>5.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>600036</td>\n",
       "      <td>招商银行</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>1.5600</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>603896</td>\n",
       "      <td>寿仙谷</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.3700</td>\n",
       "      <td>31.81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>600590</td>\n",
       "      <td>泰豪科技</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>0.1000</td>\n",
       "      <td>55.39%~77.59%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2496</th>\n",
       "      <td>002237</td>\n",
       "      <td>恒邦股份</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-18</td>\n",
       "      <td>0.2200</td>\n",
       "      <td>0%~30%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2497</th>\n",
       "      <td>002129</td>\n",
       "      <td>中环股份</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-18</td>\n",
       "      <td>0.1036</td>\n",
       "      <td>9%~28%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2498</th>\n",
       "      <td>002085</td>\n",
       "      <td>万丰奥威</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-18</td>\n",
       "      <td>0.2200</td>\n",
       "      <td>15%~30%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2499</th>\n",
       "      <td>002661</td>\n",
       "      <td>克明面业</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.2000</td>\n",
       "      <td>50%~90%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2500</th>\n",
       "      <td>002571</td>\n",
       "      <td>德力股份</td>\n",
       "      <td>预亏</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.0803</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2501</th>\n",
       "      <td>000068</td>\n",
       "      <td>华控赛格</td>\n",
       "      <td>预亏</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>-0.0159</td>\n",
       "      <td>-75.36%~-37.78%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2502</th>\n",
       "      <td>002417</td>\n",
       "      <td>深南股份</td>\n",
       "      <td>预亏</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.0600</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2503</th>\n",
       "      <td>002294</td>\n",
       "      <td>信立泰</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.7000</td>\n",
       "      <td>5%~15%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2504</th>\n",
       "      <td>002267</td>\n",
       "      <td>陕天然气</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.2266</td>\n",
       "      <td>10%~50%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2505</th>\n",
       "      <td>002240</td>\n",
       "      <td>威华股份</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.0159</td>\n",
       "      <td>523.5%~568.49%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2506</th>\n",
       "      <td>002168</td>\n",
       "      <td>深圳惠程</td>\n",
       "      <td>预盈</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>-0.0800</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2507</th>\n",
       "      <td>002825</td>\n",
       "      <td>纳尔股份</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.1900</td>\n",
       "      <td>-27%~19%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2508</th>\n",
       "      <td>002572</td>\n",
       "      <td>索菲亚</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.3187</td>\n",
       "      <td>25%~45%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2509</th>\n",
       "      <td>002465</td>\n",
       "      <td>海格通信</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-17</td>\n",
       "      <td>0.0600</td>\n",
       "      <td>20%~50%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2510</th>\n",
       "      <td>002767</td>\n",
       "      <td>先锋电子</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-16</td>\n",
       "      <td>0.1094</td>\n",
       "      <td>-25%~15%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2511</th>\n",
       "      <td>002117</td>\n",
       "      <td>东港股份</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-16</td>\n",
       "      <td>0.2745</td>\n",
       "      <td>10%~50%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2512</th>\n",
       "      <td>002349</td>\n",
       "      <td>精华制药</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-16</td>\n",
       "      <td>0.1146</td>\n",
       "      <td>20%~60%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2513</th>\n",
       "      <td>002286</td>\n",
       "      <td>保龄宝</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-16</td>\n",
       "      <td>0.1000</td>\n",
       "      <td>0%~50%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2514</th>\n",
       "      <td>603773</td>\n",
       "      <td>沃格光电</td>\n",
       "      <td>预平</td>\n",
       "      <td>2018-04-16</td>\n",
       "      <td>1.4100</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2515</th>\n",
       "      <td>002350</td>\n",
       "      <td>北京科锐</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-14</td>\n",
       "      <td>0.0373</td>\n",
       "      <td>50%~100%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2516</th>\n",
       "      <td>002278</td>\n",
       "      <td>神开股份</td>\n",
       "      <td>预盈</td>\n",
       "      <td>2018-04-14</td>\n",
       "      <td>-0.0300</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2517</th>\n",
       "      <td>002521</td>\n",
       "      <td>齐峰新材</td>\n",
       "      <td>预降</td>\n",
       "      <td>2018-04-14</td>\n",
       "      <td>0.1900</td>\n",
       "      <td>-40%~-10%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2518</th>\n",
       "      <td>002189</td>\n",
       "      <td>利达光电</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-14</td>\n",
       "      <td>0.0400</td>\n",
       "      <td>50%~100%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2519</th>\n",
       "      <td>002009</td>\n",
       "      <td>天奇股份</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-13</td>\n",
       "      <td>0.1400</td>\n",
       "      <td>120%~170%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2520</th>\n",
       "      <td>002653</td>\n",
       "      <td>海思科</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-12</td>\n",
       "      <td>0.1300</td>\n",
       "      <td>20%~40%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2521</th>\n",
       "      <td>002818</td>\n",
       "      <td>富森美</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-11</td>\n",
       "      <td>0.7700</td>\n",
       "      <td>12.64%~33.39%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2522</th>\n",
       "      <td>002772</td>\n",
       "      <td>众兴菌业</td>\n",
       "      <td>预升</td>\n",
       "      <td>2018-04-10</td>\n",
       "      <td>0.1757</td>\n",
       "      <td>10%~40%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2523</th>\n",
       "      <td>002536</td>\n",
       "      <td>西泵股份</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-10</td>\n",
       "      <td>0.2800</td>\n",
       "      <td>20%~50%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2524</th>\n",
       "      <td>002313</td>\n",
       "      <td>日海智能</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-10</td>\n",
       "      <td>0.0900</td>\n",
       "      <td>67.19%~115.96%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2525</th>\n",
       "      <td>300568</td>\n",
       "      <td>星源材质</td>\n",
       "      <td>预增</td>\n",
       "      <td>2018-04-10</td>\n",
       "      <td>0.3700</td>\n",
       "      <td>79.16%~96.77%</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2526 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        code  name type report_date  pre_eps            range\n",
       "0     601968  宝钢包装   预盈  2018-07-26  -0.0300                0\n",
       "1     601878  浙商证券   预降  2018-07-26   0.1800           -23.97\n",
       "2     002262  恩华药业   预升  2018-07-26   0.2073             25.2\n",
       "3     600794  保税科技   预盈  2018-07-26  -0.0717                0\n",
       "4     002116  中国海诚   预升  2018-07-26   0.2100            11.08\n",
       "5     000598  兴蓉环境   预升  2018-07-26   0.1500            17.31\n",
       "6     002080  中材科技   预升  2018-07-26   0.4630             2.91\n",
       "7     002028  思源电气   预降  2018-07-26   0.1900            -8.12\n",
       "8     000550  江铃汽车   预降  2018-07-26   0.6400           -42.31\n",
       "9     002605  姚记扑克   预升  2018-07-26   0.0899             24.5\n",
       "10    601718  际华集团   预减  2018-07-26   0.1300  -68.53%~-53.87%\n",
       "11    002235  安妮股份   预升  2018-07-26   0.0910            29.98\n",
       "12    603227  雪峰科技   预盈  2018-07-26  -0.0040                0\n",
       "13    600410  华胜天成   预减  2018-07-26   0.1400           -92.39\n",
       "14    002142  宁波银行   预升  2018-07-26   0.9400            19.64\n",
       "15    000058   深赛格   预增  2018-07-26   0.0405             95.3\n",
       "16    600558   大西洋   预增  2018-07-26   0.0250         90%~110%\n",
       "17    002287  奇正藏药   预升  2018-07-26   0.4179            12.04\n",
       "18    600578  京能电力   预增  2018-07-25   0.0100              380\n",
       "19    000049  德赛电池   预升  2018-07-25   0.5578            16.49\n",
       "20    002030  达安基因   预升  2018-07-25   0.0800             2.34\n",
       "21    002083  孚日股份   预降  2018-07-25   0.2684           -20.75\n",
       "22    603416  信捷电气   预升  2018-07-25   0.4600             5.52\n",
       "23    600183  生益科技   预降  2018-07-25   0.3700            -1.25\n",
       "24    600028  中国石化   预增  2018-07-25   0.2240               50\n",
       "25    603368  柳药股份   预升  2018-07-25   1.2800            33.25\n",
       "26    002795  永和智控   预升  2018-07-25   0.2600             5.85\n",
       "27    600036  招商银行   预升  2018-07-25   1.5600               14\n",
       "28    603896   寿仙谷   预升  2018-07-25   0.3700            31.81\n",
       "29    600590  泰豪科技   预增  2018-07-25   0.1000    55.39%~77.59%\n",
       "...      ...   ...  ...         ...      ...              ...\n",
       "2496  002237  恒邦股份   预升  2018-04-18   0.2200           0%~30%\n",
       "2497  002129  中环股份   预升  2018-04-18   0.1036           9%~28%\n",
       "2498  002085  万丰奥威   预升  2018-04-18   0.2200          15%~30%\n",
       "2499  002661  克明面业   预增  2018-04-17   0.2000          50%~90%\n",
       "2500  002571  德力股份   预亏  2018-04-17   0.0803                0\n",
       "2501  000068  华控赛格   预亏  2018-04-17  -0.0159  -75.36%~-37.78%\n",
       "2502  002417  深南股份   预亏  2018-04-17   0.0600                0\n",
       "2503  002294   信立泰   预升  2018-04-17   0.7000           5%~15%\n",
       "2504  002267  陕天然气   预增  2018-04-17   0.2266          10%~50%\n",
       "2505  002240  威华股份   预增  2018-04-17   0.0159   523.5%~568.49%\n",
       "2506  002168  深圳惠程   预盈  2018-04-17  -0.0800                0\n",
       "2507  002825  纳尔股份   预升  2018-04-17   0.1900         -27%~19%\n",
       "2508  002572   索菲亚   预升  2018-04-17   0.3187          25%~45%\n",
       "2509  002465  海格通信   预增  2018-04-17   0.0600          20%~50%\n",
       "2510  002767  先锋电子   预升  2018-04-16   0.1094         -25%~15%\n",
       "2511  002117  东港股份   预增  2018-04-16   0.2745          10%~50%\n",
       "2512  002349  精华制药   预增  2018-04-16   0.1146          20%~60%\n",
       "2513  002286   保龄宝   预增  2018-04-16   0.1000           0%~50%\n",
       "2514  603773  沃格光电   预平  2018-04-16   1.4100                0\n",
       "2515  002350  北京科锐   预增  2018-04-14   0.0373         50%~100%\n",
       "2516  002278  神开股份   预盈  2018-04-14  -0.0300                0\n",
       "2517  002521  齐峰新材   预降  2018-04-14   0.1900        -40%~-10%\n",
       "2518  002189  利达光电   预增  2018-04-14   0.0400         50%~100%\n",
       "2519  002009  天奇股份   预增  2018-04-13   0.1400        120%~170%\n",
       "2520  002653   海思科   预升  2018-04-12   0.1300          20%~40%\n",
       "2521  002818   富森美   预升  2018-04-11   0.7700    12.64%~33.39%\n",
       "2522  002772  众兴菌业   预升  2018-04-10   0.1757          10%~40%\n",
       "2523  002536  西泵股份   预增  2018-04-10   0.2800          20%~50%\n",
       "2524  002313  日海智能   预增  2018-04-10   0.0900   67.19%~115.96%\n",
       "2525  300568  星源材质   预增  2018-04-10   0.3700    79.16%~96.77%\n",
       "\n",
       "[2526 rows x 6 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.forecast_data(2018,2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 限售股解禁\n",
    "\n",
    "以月的形式返回限售股解禁情况，通过了解解禁股本的大小，判断股票上行的压力。可通过设定年份和月份参数获取不同时段的数据。\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    year:年份,默认为当前年\n",
    "    month:解禁月份，默认为当前月\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    code：股票代码\n",
    "    name：股票名称\n",
    "    date:解禁日期\n",
    "    count:解禁数量（万股）\n",
    "    ratio:占总盘比率\n",
    "\n",
    "调用方法：\n",
    "\n",
    "import tushare as ts\n",
    "\n",
    "ts.xsg_data()\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 基金持股\n",
    "\n",
    "获取每个季度基金持有上市公司股票的数据。\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    year:年份,默认为当前年\n",
    "    quarter:季度（只能输入1，2，3，4这个四个数字）\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    code：股票代码\n",
    "    name：股票名称\n",
    "    date:报告日期\n",
    "    nums:基金家数\n",
    "    nlast:与上期相比（增加或减少了）\n",
    "    count:基金持股数（万股）\n",
    "    clast:与上期相比\n",
    "    amount:基金持股市值\n",
    "    ratio:占流通盘比率\n",
    "\n",
    "调用方法：\n",
    "\n",
    "import tushare as ts\n",
    "\n",
    "ts.fund_holdings(2014, 4)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 新股数据\n",
    "\n",
    "获取IPO发行和上市的时间列表，包括发行数量、网上发行数量、发行价格已经中签率信息等。\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    code：股票代码\n",
    "    name：股票名称\n",
    "    ipo_date:上网发行日期\n",
    "    issue_date:上市日期\n",
    "    amount:发行数量(万股)\n",
    "    markets:上网发行数量(万股)\n",
    "    price:发行价格(元)\n",
    "    pe:发行市盈率\n",
    "    limit:个人申购上限(万股)\n",
    "    funds：募集资金(亿元)\n",
    "    ballot:网上中签率(%)\n",
    "\n",
    "调用方法：\n",
    "\n",
    "import tushare as ts\n",
    "\n",
    "ts.new_stocks()\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Getting data:]#################"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>code</th>\n",
       "      <th>xcode</th>\n",
       "      <th>name</th>\n",
       "      <th>ipo_date</th>\n",
       "      <th>issue_date</th>\n",
       "      <th>amount</th>\n",
       "      <th>markets</th>\n",
       "      <th>price</th>\n",
       "      <th>pe</th>\n",
       "      <th>limit</th>\n",
       "      <th>funds</th>\n",
       "      <th>ballot</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>603192</td>\n",
       "      <td>732192</td>\n",
       "      <td>汇得科技</td>\n",
       "      <td>2018-08-16</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2667</td>\n",
       "      <td>1067</td>\n",
       "      <td>19.60</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.00</td>\n",
       "      <td>5.227</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>300724</td>\n",
       "      <td>300724</td>\n",
       "      <td>捷佳伟创</td>\n",
       "      <td>2018-08-01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8000</td>\n",
       "      <td>3200</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>3.20</td>\n",
       "      <td>11.328</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>601068</td>\n",
       "      <td>780068</td>\n",
       "      <td>中铝国际</td>\n",
       "      <td>2018-07-31</td>\n",
       "      <td>NaN</td>\n",
       "      <td>29591</td>\n",
       "      <td>8877</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>8.80</td>\n",
       "      <td>10.209</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>601606</td>\n",
       "      <td>780606</td>\n",
       "      <td>长城军工</td>\n",
       "      <td>2018-07-25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>14800</td>\n",
       "      <td>4440</td>\n",
       "      <td>3.33</td>\n",
       "      <td>22.93</td>\n",
       "      <td>4.40</td>\n",
       "      <td>4.932</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603657</td>\n",
       "      <td>732657</td>\n",
       "      <td>春光科技</td>\n",
       "      <td>2018-07-18</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2400</td>\n",
       "      <td>2160</td>\n",
       "      <td>18.46</td>\n",
       "      <td>22.99</td>\n",
       "      <td>0.90</td>\n",
       "      <td>4.430</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>601869</td>\n",
       "      <td>780869</td>\n",
       "      <td>长飞光纤</td>\n",
       "      <td>2018-07-10</td>\n",
       "      <td>2018-07-20</td>\n",
       "      <td>7579</td>\n",
       "      <td>6821</td>\n",
       "      <td>26.71</td>\n",
       "      <td>16.38</td>\n",
       "      <td>2.20</td>\n",
       "      <td>20.244</td>\n",
       "      <td>0.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>603713</td>\n",
       "      <td>732713</td>\n",
       "      <td>密尔克卫</td>\n",
       "      <td>2018-07-04</td>\n",
       "      <td>2018-07-13</td>\n",
       "      <td>3812</td>\n",
       "      <td>3431</td>\n",
       "      <td>11.27</td>\n",
       "      <td>20.53</td>\n",
       "      <td>1.50</td>\n",
       "      <td>4.811</td>\n",
       "      <td>0.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>002932</td>\n",
       "      <td>002932</td>\n",
       "      <td>明德生物</td>\n",
       "      <td>2018-06-29</td>\n",
       "      <td>2018-07-10</td>\n",
       "      <td>1665</td>\n",
       "      <td>1665</td>\n",
       "      <td>20.45</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.65</td>\n",
       "      <td>3.404</td>\n",
       "      <td>0.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>603105</td>\n",
       "      <td>732105</td>\n",
       "      <td>芯能科技</td>\n",
       "      <td>2018-06-27</td>\n",
       "      <td>2018-07-09</td>\n",
       "      <td>8800</td>\n",
       "      <td>7920</td>\n",
       "      <td>4.83</td>\n",
       "      <td>22.96</td>\n",
       "      <td>2.60</td>\n",
       "      <td>4.250</td>\n",
       "      <td>0.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>603706</td>\n",
       "      <td>732706</td>\n",
       "      <td>东方环宇</td>\n",
       "      <td>2018-06-27</td>\n",
       "      <td>2018-07-09</td>\n",
       "      <td>4000</td>\n",
       "      <td>3600</td>\n",
       "      <td>13.09</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.60</td>\n",
       "      <td>5.236</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>603693</td>\n",
       "      <td>732693</td>\n",
       "      <td>江苏新能</td>\n",
       "      <td>2018-06-21</td>\n",
       "      <td>2018-07-03</td>\n",
       "      <td>11800</td>\n",
       "      <td>10620</td>\n",
       "      <td>9.00</td>\n",
       "      <td>17.87</td>\n",
       "      <td>3.50</td>\n",
       "      <td>10.706</td>\n",
       "      <td>0.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>603650</td>\n",
       "      <td>732650</td>\n",
       "      <td>彤程新材</td>\n",
       "      <td>2018-06-14</td>\n",
       "      <td>2018-06-27</td>\n",
       "      <td>5880</td>\n",
       "      <td>5292</td>\n",
       "      <td>12.32</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.70</td>\n",
       "      <td>7.244</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>300747</td>\n",
       "      <td>300747</td>\n",
       "      <td>锐科激光</td>\n",
       "      <td>2018-06-13</td>\n",
       "      <td>2018-06-25</td>\n",
       "      <td>3200</td>\n",
       "      <td>2880</td>\n",
       "      <td>38.11</td>\n",
       "      <td>17.96</td>\n",
       "      <td>1.25</td>\n",
       "      <td>12.195</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>603587</td>\n",
       "      <td>732587</td>\n",
       "      <td>地素时尚</td>\n",
       "      <td>2018-06-12</td>\n",
       "      <td>2018-06-22</td>\n",
       "      <td>6100</td>\n",
       "      <td>5490</td>\n",
       "      <td>27.52</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.80</td>\n",
       "      <td>16.787</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>601066</td>\n",
       "      <td>780066</td>\n",
       "      <td>中信建投</td>\n",
       "      <td>2018-06-07</td>\n",
       "      <td>2018-06-20</td>\n",
       "      <td>40000</td>\n",
       "      <td>36000</td>\n",
       "      <td>5.42</td>\n",
       "      <td>11.21</td>\n",
       "      <td>12.00</td>\n",
       "      <td>21.680</td>\n",
       "      <td>0.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>601990</td>\n",
       "      <td>780990</td>\n",
       "      <td>南京证券</td>\n",
       "      <td>2018-06-01</td>\n",
       "      <td>2018-06-13</td>\n",
       "      <td>27502</td>\n",
       "      <td>24752</td>\n",
       "      <td>3.79</td>\n",
       "      <td>25.61</td>\n",
       "      <td>8.20</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>603666</td>\n",
       "      <td>732666</td>\n",
       "      <td>亿嘉和</td>\n",
       "      <td>2018-05-31</td>\n",
       "      <td>2018-06-12</td>\n",
       "      <td>1754</td>\n",
       "      <td>1754</td>\n",
       "      <td>34.46</td>\n",
       "      <td>19.50</td>\n",
       "      <td>1.70</td>\n",
       "      <td>6.046</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>300750</td>\n",
       "      <td>300750</td>\n",
       "      <td>宁德时代</td>\n",
       "      <td>2018-05-30</td>\n",
       "      <td>2018-06-11</td>\n",
       "      <td>21724</td>\n",
       "      <td>19552</td>\n",
       "      <td>25.14</td>\n",
       "      <td>22.99</td>\n",
       "      <td>6.50</td>\n",
       "      <td>54.615</td>\n",
       "      <td>0.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>601330</td>\n",
       "      <td>780330</td>\n",
       "      <td>绿色动力</td>\n",
       "      <td>2018-05-30</td>\n",
       "      <td>2018-06-11</td>\n",
       "      <td>11620</td>\n",
       "      <td>10458</td>\n",
       "      <td>3.29</td>\n",
       "      <td>19.56</td>\n",
       "      <td>3.40</td>\n",
       "      <td>3.823</td>\n",
       "      <td>0.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>601138</td>\n",
       "      <td>780138</td>\n",
       "      <td>工业富联</td>\n",
       "      <td>2018-05-24</td>\n",
       "      <td>2018-06-08</td>\n",
       "      <td>196953</td>\n",
       "      <td>100610</td>\n",
       "      <td>13.77</td>\n",
       "      <td>17.09</td>\n",
       "      <td>41.30</td>\n",
       "      <td>267.960</td>\n",
       "      <td>0.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>603486</td>\n",
       "      <td>732486</td>\n",
       "      <td>科沃斯</td>\n",
       "      <td>2018-05-16</td>\n",
       "      <td>2018-05-28</td>\n",
       "      <td>4010</td>\n",
       "      <td>3609</td>\n",
       "      <td>20.02</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.20</td>\n",
       "      <td>8.028</td>\n",
       "      <td>0.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>300746</td>\n",
       "      <td>300746</td>\n",
       "      <td>汉嘉设计</td>\n",
       "      <td>2018-05-16</td>\n",
       "      <td>2018-05-25</td>\n",
       "      <td>5260</td>\n",
       "      <td>4734</td>\n",
       "      <td>5.62</td>\n",
       "      <td>21.45</td>\n",
       "      <td>2.10</td>\n",
       "      <td>2.956</td>\n",
       "      <td>0.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>300745</td>\n",
       "      <td>300745</td>\n",
       "      <td>欣锐科技</td>\n",
       "      <td>2018-05-14</td>\n",
       "      <td>2018-05-23</td>\n",
       "      <td>2863</td>\n",
       "      <td>2577</td>\n",
       "      <td>11.65</td>\n",
       "      <td>17.29</td>\n",
       "      <td>1.10</td>\n",
       "      <td>4.435</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>603045</td>\n",
       "      <td>732045</td>\n",
       "      <td>福达合金</td>\n",
       "      <td>2018-05-07</td>\n",
       "      <td>2018-05-17</td>\n",
       "      <td>2458</td>\n",
       "      <td>2212</td>\n",
       "      <td>9.65</td>\n",
       "      <td>20.03</td>\n",
       "      <td>0.90</td>\n",
       "      <td>2.372</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>300454</td>\n",
       "      <td>300454</td>\n",
       "      <td>深信服</td>\n",
       "      <td>2018-05-07</td>\n",
       "      <td>2018-05-16</td>\n",
       "      <td>4001</td>\n",
       "      <td>3601</td>\n",
       "      <td>30.07</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.20</td>\n",
       "      <td>12.031</td>\n",
       "      <td>0.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>603013</td>\n",
       "      <td>732013</td>\n",
       "      <td>亚普股份</td>\n",
       "      <td>2018-04-25</td>\n",
       "      <td>2018-05-09</td>\n",
       "      <td>6000</td>\n",
       "      <td>5400</td>\n",
       "      <td>11.67</td>\n",
       "      <td>18.00</td>\n",
       "      <td>1.80</td>\n",
       "      <td>7.002</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>300742</td>\n",
       "      <td>300742</td>\n",
       "      <td>越博动力</td>\n",
       "      <td>2018-04-25</td>\n",
       "      <td>2018-05-08</td>\n",
       "      <td>1963</td>\n",
       "      <td>1963</td>\n",
       "      <td>23.34</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.95</td>\n",
       "      <td>4.582</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>603259</td>\n",
       "      <td>732259</td>\n",
       "      <td>药明康德</td>\n",
       "      <td>2018-04-24</td>\n",
       "      <td>2018-05-08</td>\n",
       "      <td>10420</td>\n",
       "      <td>9378</td>\n",
       "      <td>21.60</td>\n",
       "      <td>22.99</td>\n",
       "      <td>3.10</td>\n",
       "      <td>22.507</td>\n",
       "      <td>0.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>603596</td>\n",
       "      <td>732596</td>\n",
       "      <td>伯特利</td>\n",
       "      <td>2018-04-18</td>\n",
       "      <td>2018-04-27</td>\n",
       "      <td>4086</td>\n",
       "      <td>3677</td>\n",
       "      <td>15.10</td>\n",
       "      <td>22.88</td>\n",
       "      <td>1.20</td>\n",
       "      <td>6.170</td>\n",
       "      <td>0.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>603348</td>\n",
       "      <td>732348</td>\n",
       "      <td>文灿股份</td>\n",
       "      <td>2018-04-16</td>\n",
       "      <td>2018-04-26</td>\n",
       "      <td>5500</td>\n",
       "      <td>4950</td>\n",
       "      <td>15.26</td>\n",
       "      <td>22.99</td>\n",
       "      <td>2.20</td>\n",
       "      <td>8.393</td>\n",
       "      <td>0.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>628</th>\n",
       "      <td>002811</td>\n",
       "      <td>002811</td>\n",
       "      <td>亚泰国际</td>\n",
       "      <td>2016-08-30</td>\n",
       "      <td>2016-09-08</td>\n",
       "      <td>4500</td>\n",
       "      <td>4050</td>\n",
       "      <td>13.99</td>\n",
       "      <td>22.98</td>\n",
       "      <td>1.80</td>\n",
       "      <td>6.295</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>629</th>\n",
       "      <td>300543</td>\n",
       "      <td>300543</td>\n",
       "      <td>朗科智能</td>\n",
       "      <td>2016-08-25</td>\n",
       "      <td>2016-09-08</td>\n",
       "      <td>1500</td>\n",
       "      <td>1500</td>\n",
       "      <td>22.52</td>\n",
       "      <td>22.46</td>\n",
       "      <td>1.50</td>\n",
       "      <td>3.378</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>630</th>\n",
       "      <td>002807</td>\n",
       "      <td>002807</td>\n",
       "      <td>江阴银行</td>\n",
       "      <td>2016-08-24</td>\n",
       "      <td>2016-09-02</td>\n",
       "      <td>20945</td>\n",
       "      <td>18850</td>\n",
       "      <td>4.64</td>\n",
       "      <td>10.17</td>\n",
       "      <td>5.90</td>\n",
       "      <td>9.718</td>\n",
       "      <td>0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>631</th>\n",
       "      <td>603843</td>\n",
       "      <td>732843</td>\n",
       "      <td>正平股份</td>\n",
       "      <td>2016-08-24</td>\n",
       "      <td>2016-09-05</td>\n",
       "      <td>9970</td>\n",
       "      <td>8973</td>\n",
       "      <td>5.03</td>\n",
       "      <td>22.97</td>\n",
       "      <td>2.90</td>\n",
       "      <td>5.015</td>\n",
       "      <td>0.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>632</th>\n",
       "      <td>300539</td>\n",
       "      <td>300539</td>\n",
       "      <td>横河模具</td>\n",
       "      <td>2016-08-19</td>\n",
       "      <td>2016-08-30</td>\n",
       "      <td>2375</td>\n",
       "      <td>2138</td>\n",
       "      <td>6.12</td>\n",
       "      <td>22.96</td>\n",
       "      <td>0.90</td>\n",
       "      <td>1.454</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>633</th>\n",
       "      <td>603658</td>\n",
       "      <td>732658</td>\n",
       "      <td>安图生物</td>\n",
       "      <td>2016-08-19</td>\n",
       "      <td>2016-09-01</td>\n",
       "      <td>4200</td>\n",
       "      <td>3780</td>\n",
       "      <td>14.58</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.20</td>\n",
       "      <td>6.124</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>634</th>\n",
       "      <td>300537</td>\n",
       "      <td>300537</td>\n",
       "      <td>广信材料</td>\n",
       "      <td>2016-08-17</td>\n",
       "      <td>2016-08-30</td>\n",
       "      <td>2500</td>\n",
       "      <td>2250</td>\n",
       "      <td>9.19</td>\n",
       "      <td>22.98</td>\n",
       "      <td>1.00</td>\n",
       "      <td>3.038</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>635</th>\n",
       "      <td>603090</td>\n",
       "      <td>732090</td>\n",
       "      <td>宏盛股份</td>\n",
       "      <td>2016-08-16</td>\n",
       "      <td>2016-08-31</td>\n",
       "      <td>2500</td>\n",
       "      <td>2250</td>\n",
       "      <td>8.47</td>\n",
       "      <td>22.98</td>\n",
       "      <td>1.00</td>\n",
       "      <td>2.118</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>636</th>\n",
       "      <td>002810</td>\n",
       "      <td>002810</td>\n",
       "      <td>山东赫达</td>\n",
       "      <td>2016-08-16</td>\n",
       "      <td>2016-08-26</td>\n",
       "      <td>2398</td>\n",
       "      <td>2158</td>\n",
       "      <td>9.91</td>\n",
       "      <td>22.98</td>\n",
       "      <td>0.85</td>\n",
       "      <td>2.376</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>637</th>\n",
       "      <td>603007</td>\n",
       "      <td>732007</td>\n",
       "      <td>花王股份</td>\n",
       "      <td>2016-08-12</td>\n",
       "      <td>2016-08-26</td>\n",
       "      <td>3335</td>\n",
       "      <td>3002</td>\n",
       "      <td>11.66</td>\n",
       "      <td>22.97</td>\n",
       "      <td>1.30</td>\n",
       "      <td>3.889</td>\n",
       "      <td>0.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>638</th>\n",
       "      <td>300538</td>\n",
       "      <td>300538</td>\n",
       "      <td>同益股份</td>\n",
       "      <td>2016-08-12</td>\n",
       "      <td>2016-08-26</td>\n",
       "      <td>1400</td>\n",
       "      <td>1400</td>\n",
       "      <td>15.85</td>\n",
       "      <td>22.98</td>\n",
       "      <td>1.40</td>\n",
       "      <td>2.219</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>639</th>\n",
       "      <td>002809</td>\n",
       "      <td>002809</td>\n",
       "      <td>红墙股份</td>\n",
       "      <td>2016-08-11</td>\n",
       "      <td>2016-08-23</td>\n",
       "      <td>2000</td>\n",
       "      <td>2000</td>\n",
       "      <td>22.46</td>\n",
       "      <td>22.69</td>\n",
       "      <td>2.00</td>\n",
       "      <td>4.492</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>640</th>\n",
       "      <td>603031</td>\n",
       "      <td>732031</td>\n",
       "      <td>安德利</td>\n",
       "      <td>2016-08-10</td>\n",
       "      <td>2016-08-22</td>\n",
       "      <td>2000</td>\n",
       "      <td>2000</td>\n",
       "      <td>11.71</td>\n",
       "      <td>22.99</td>\n",
       "      <td>2.00</td>\n",
       "      <td>2.342</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>641</th>\n",
       "      <td>300540</td>\n",
       "      <td>300540</td>\n",
       "      <td>深冷股份</td>\n",
       "      <td>2016-08-10</td>\n",
       "      <td>2016-08-23</td>\n",
       "      <td>2000</td>\n",
       "      <td>2000</td>\n",
       "      <td>16.67</td>\n",
       "      <td>22.98</td>\n",
       "      <td>2.00</td>\n",
       "      <td>3.334</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>642</th>\n",
       "      <td>603515</td>\n",
       "      <td>732515</td>\n",
       "      <td>欧普照明</td>\n",
       "      <td>2016-08-09</td>\n",
       "      <td>2016-08-19</td>\n",
       "      <td>5800</td>\n",
       "      <td>5220</td>\n",
       "      <td>14.94</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.70</td>\n",
       "      <td>8.665</td>\n",
       "      <td>0.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643</th>\n",
       "      <td>300533</td>\n",
       "      <td>300533</td>\n",
       "      <td>冰川网络</td>\n",
       "      <td>2016-08-09</td>\n",
       "      <td>2016-08-18</td>\n",
       "      <td>2500</td>\n",
       "      <td>2250</td>\n",
       "      <td>37.02</td>\n",
       "      <td>21.97</td>\n",
       "      <td>1.00</td>\n",
       "      <td>9.255</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>644</th>\n",
       "      <td>603986</td>\n",
       "      <td>732986</td>\n",
       "      <td>兆易创新</td>\n",
       "      <td>2016-08-08</td>\n",
       "      <td>2016-08-18</td>\n",
       "      <td>2500</td>\n",
       "      <td>2250</td>\n",
       "      <td>23.26</td>\n",
       "      <td>16.41</td>\n",
       "      <td>1.00</td>\n",
       "      <td>5.815</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>645</th>\n",
       "      <td>300532</td>\n",
       "      <td>300532</td>\n",
       "      <td>今天国际</td>\n",
       "      <td>2016-08-05</td>\n",
       "      <td>2016-08-18</td>\n",
       "      <td>2100</td>\n",
       "      <td>1890</td>\n",
       "      <td>16.32</td>\n",
       "      <td>22.99</td>\n",
       "      <td>0.80</td>\n",
       "      <td>3.427</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>646</th>\n",
       "      <td>601595</td>\n",
       "      <td>780595</td>\n",
       "      <td>上海电影</td>\n",
       "      <td>2016-08-05</td>\n",
       "      <td>2016-08-17</td>\n",
       "      <td>9350</td>\n",
       "      <td>8415</td>\n",
       "      <td>10.19</td>\n",
       "      <td>22.25</td>\n",
       "      <td>3.70</td>\n",
       "      <td>9.537</td>\n",
       "      <td>0.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>647</th>\n",
       "      <td>601997</td>\n",
       "      <td>780997</td>\n",
       "      <td>贵阳银行</td>\n",
       "      <td>2016-08-04</td>\n",
       "      <td>2016-08-16</td>\n",
       "      <td>50000</td>\n",
       "      <td>45000</td>\n",
       "      <td>8.49</td>\n",
       "      <td>6.08</td>\n",
       "      <td>15.00</td>\n",
       "      <td>42.450</td>\n",
       "      <td>0.22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>648</th>\n",
       "      <td>002808</td>\n",
       "      <td>002808</td>\n",
       "      <td>苏州恒久</td>\n",
       "      <td>2016-08-03</td>\n",
       "      <td>2016-08-12</td>\n",
       "      <td>3000</td>\n",
       "      <td>2700</td>\n",
       "      <td>7.71</td>\n",
       "      <td>22.99</td>\n",
       "      <td>1.20</td>\n",
       "      <td>2.314</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>649</th>\n",
       "      <td>600936</td>\n",
       "      <td>730936</td>\n",
       "      <td>广西广电</td>\n",
       "      <td>2016-08-03</td>\n",
       "      <td>2016-08-15</td>\n",
       "      <td>30000</td>\n",
       "      <td>27000</td>\n",
       "      <td>4.80</td>\n",
       "      <td>22.86</td>\n",
       "      <td>9.00</td>\n",
       "      <td>14.400</td>\n",
       "      <td>0.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>650</th>\n",
       "      <td>603159</td>\n",
       "      <td>732159</td>\n",
       "      <td>上海亚虹</td>\n",
       "      <td>2016-08-02</td>\n",
       "      <td>2016-08-12</td>\n",
       "      <td>2500</td>\n",
       "      <td>2250</td>\n",
       "      <td>6.88</td>\n",
       "      <td>18.30</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1.720</td>\n",
       "      <td>0.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>651</th>\n",
       "      <td>300535</td>\n",
       "      <td>300535</td>\n",
       "      <td>达威股份</td>\n",
       "      <td>2016-08-01</td>\n",
       "      <td>2016-08-12</td>\n",
       "      <td>1494</td>\n",
       "      <td>1494</td>\n",
       "      <td>18.50</td>\n",
       "      <td>22.98</td>\n",
       "      <td>1.45</td>\n",
       "      <td>2.764</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>652</th>\n",
       "      <td>300530</td>\n",
       "      <td>300530</td>\n",
       "      <td>达志科技</td>\n",
       "      <td>2016-07-29</td>\n",
       "      <td>2016-08-09</td>\n",
       "      <td>1750</td>\n",
       "      <td>1750</td>\n",
       "      <td>11.95</td>\n",
       "      <td>22.98</td>\n",
       "      <td>1.75</td>\n",
       "      <td>2.091</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>653</th>\n",
       "      <td>603569</td>\n",
       "      <td>732569</td>\n",
       "      <td>长久物流</td>\n",
       "      <td>2016-07-29</td>\n",
       "      <td>2016-08-10</td>\n",
       "      <td>4001</td>\n",
       "      <td>3601</td>\n",
       "      <td>15.43</td>\n",
       "      <td>22.98</td>\n",
       "      <td>1.20</td>\n",
       "      <td>6.174</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>654</th>\n",
       "      <td>600977</td>\n",
       "      <td>730977</td>\n",
       "      <td>中国电影</td>\n",
       "      <td>2016-07-28</td>\n",
       "      <td>2016-08-09</td>\n",
       "      <td>46700</td>\n",
       "      <td>42030</td>\n",
       "      <td>8.92</td>\n",
       "      <td>22.98</td>\n",
       "      <td>14.00</td>\n",
       "      <td>41.656</td>\n",
       "      <td>0.22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>655</th>\n",
       "      <td>601811</td>\n",
       "      <td>780811</td>\n",
       "      <td>新华文轩</td>\n",
       "      <td>2016-07-27</td>\n",
       "      <td>2016-08-08</td>\n",
       "      <td>9871</td>\n",
       "      <td>8884</td>\n",
       "      <td>7.12</td>\n",
       "      <td>14.67</td>\n",
       "      <td>2.90</td>\n",
       "      <td>7.028</td>\n",
       "      <td>0.08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>656</th>\n",
       "      <td>300531</td>\n",
       "      <td>300531</td>\n",
       "      <td>优博讯</td>\n",
       "      <td>2016-07-27</td>\n",
       "      <td>2016-08-09</td>\n",
       "      <td>2000</td>\n",
       "      <td>2000</td>\n",
       "      <td>13.36</td>\n",
       "      <td>22.98</td>\n",
       "      <td>2.00</td>\n",
       "      <td>2.672</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>657</th>\n",
       "      <td>300528</td>\n",
       "      <td>300528</td>\n",
       "      <td>幸福蓝海</td>\n",
       "      <td>2016-07-26</td>\n",
       "      <td>2016-08-08</td>\n",
       "      <td>7763</td>\n",
       "      <td>6987</td>\n",
       "      <td>6.62</td>\n",
       "      <td>22.98</td>\n",
       "      <td>3.10</td>\n",
       "      <td>5.140</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>658 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       code   xcode  name    ipo_date  issue_date  amount  markets  price  \\\n",
       "0    603192  732192  汇得科技  2018-08-16         NaN    2667     1067  19.60   \n",
       "1    300724  300724  捷佳伟创  2018-08-01         NaN    8000     3200   0.00   \n",
       "2    601068  780068  中铝国际  2018-07-31         NaN   29591     8877   0.00   \n",
       "3    601606  780606  长城军工  2018-07-25         NaN   14800     4440   3.33   \n",
       "4    603657  732657  春光科技  2018-07-18         NaN    2400     2160  18.46   \n",
       "5    601869  780869  长飞光纤  2018-07-10  2018-07-20    7579     6821  26.71   \n",
       "6    603713  732713  密尔克卫  2018-07-04  2018-07-13    3812     3431  11.27   \n",
       "7    002932  002932  明德生物  2018-06-29  2018-07-10    1665     1665  20.45   \n",
       "8    603105  732105  芯能科技  2018-06-27  2018-07-09    8800     7920   4.83   \n",
       "9    603706  732706  东方环宇  2018-06-27  2018-07-09    4000     3600  13.09   \n",
       "10   603693  732693  江苏新能  2018-06-21  2018-07-03   11800    10620   9.00   \n",
       "11   603650  732650  彤程新材  2018-06-14  2018-06-27    5880     5292  12.32   \n",
       "12   300747  300747  锐科激光  2018-06-13  2018-06-25    3200     2880  38.11   \n",
       "13   603587  732587  地素时尚  2018-06-12  2018-06-22    6100     5490  27.52   \n",
       "14   601066  780066  中信建投  2018-06-07  2018-06-20   40000    36000   5.42   \n",
       "15   601990  780990  南京证券  2018-06-01  2018-06-13   27502    24752   3.79   \n",
       "16   603666  732666   亿嘉和  2018-05-31  2018-06-12    1754     1754  34.46   \n",
       "17   300750  300750  宁德时代  2018-05-30  2018-06-11   21724    19552  25.14   \n",
       "18   601330  780330  绿色动力  2018-05-30  2018-06-11   11620    10458   3.29   \n",
       "19   601138  780138  工业富联  2018-05-24  2018-06-08  196953   100610  13.77   \n",
       "20   603486  732486   科沃斯  2018-05-16  2018-05-28    4010     3609  20.02   \n",
       "21   300746  300746  汉嘉设计  2018-05-16  2018-05-25    5260     4734   5.62   \n",
       "22   300745  300745  欣锐科技  2018-05-14  2018-05-23    2863     2577  11.65   \n",
       "23   603045  732045  福达合金  2018-05-07  2018-05-17    2458     2212   9.65   \n",
       "24   300454  300454   深信服  2018-05-07  2018-05-16    4001     3601  30.07   \n",
       "25   603013  732013  亚普股份  2018-04-25  2018-05-09    6000     5400  11.67   \n",
       "26   300742  300742  越博动力  2018-04-25  2018-05-08    1963     1963  23.34   \n",
       "27   603259  732259  药明康德  2018-04-24  2018-05-08   10420     9378  21.60   \n",
       "28   603596  732596   伯特利  2018-04-18  2018-04-27    4086     3677  15.10   \n",
       "29   603348  732348  文灿股份  2018-04-16  2018-04-26    5500     4950  15.26   \n",
       "..      ...     ...   ...         ...         ...     ...      ...    ...   \n",
       "628  002811  002811  亚泰国际  2016-08-30  2016-09-08    4500     4050  13.99   \n",
       "629  300543  300543  朗科智能  2016-08-25  2016-09-08    1500     1500  22.52   \n",
       "630  002807  002807  江阴银行  2016-08-24  2016-09-02   20945    18850   4.64   \n",
       "631  603843  732843  正平股份  2016-08-24  2016-09-05    9970     8973   5.03   \n",
       "632  300539  300539  横河模具  2016-08-19  2016-08-30    2375     2138   6.12   \n",
       "633  603658  732658  安图生物  2016-08-19  2016-09-01    4200     3780  14.58   \n",
       "634  300537  300537  广信材料  2016-08-17  2016-08-30    2500     2250   9.19   \n",
       "635  603090  732090  宏盛股份  2016-08-16  2016-08-31    2500     2250   8.47   \n",
       "636  002810  002810  山东赫达  2016-08-16  2016-08-26    2398     2158   9.91   \n",
       "637  603007  732007  花王股份  2016-08-12  2016-08-26    3335     3002  11.66   \n",
       "638  300538  300538  同益股份  2016-08-12  2016-08-26    1400     1400  15.85   \n",
       "639  002809  002809  红墙股份  2016-08-11  2016-08-23    2000     2000  22.46   \n",
       "640  603031  732031   安德利  2016-08-10  2016-08-22    2000     2000  11.71   \n",
       "641  300540  300540  深冷股份  2016-08-10  2016-08-23    2000     2000  16.67   \n",
       "642  603515  732515  欧普照明  2016-08-09  2016-08-19    5800     5220  14.94   \n",
       "643  300533  300533  冰川网络  2016-08-09  2016-08-18    2500     2250  37.02   \n",
       "644  603986  732986  兆易创新  2016-08-08  2016-08-18    2500     2250  23.26   \n",
       "645  300532  300532  今天国际  2016-08-05  2016-08-18    2100     1890  16.32   \n",
       "646  601595  780595  上海电影  2016-08-05  2016-08-17    9350     8415  10.19   \n",
       "647  601997  780997  贵阳银行  2016-08-04  2016-08-16   50000    45000   8.49   \n",
       "648  002808  002808  苏州恒久  2016-08-03  2016-08-12    3000     2700   7.71   \n",
       "649  600936  730936  广西广电  2016-08-03  2016-08-15   30000    27000   4.80   \n",
       "650  603159  732159  上海亚虹  2016-08-02  2016-08-12    2500     2250   6.88   \n",
       "651  300535  300535  达威股份  2016-08-01  2016-08-12    1494     1494  18.50   \n",
       "652  300530  300530  达志科技  2016-07-29  2016-08-09    1750     1750  11.95   \n",
       "653  603569  732569  长久物流  2016-07-29  2016-08-10    4001     3601  15.43   \n",
       "654  600977  730977  中国电影  2016-07-28  2016-08-09   46700    42030   8.92   \n",
       "655  601811  780811  新华文轩  2016-07-27  2016-08-08    9871     8884   7.12   \n",
       "656  300531  300531   优博讯  2016-07-27  2016-08-09    2000     2000  13.36   \n",
       "657  300528  300528  幸福蓝海  2016-07-26  2016-08-08    7763     6987   6.62   \n",
       "\n",
       "        pe  limit    funds  ballot  \n",
       "0    22.99   1.00    5.227    0.00  \n",
       "1     0.00   3.20   11.328    0.00  \n",
       "2     0.00   8.80   10.209    0.00  \n",
       "3    22.93   4.40    4.932    0.00  \n",
       "4    22.99   0.90    4.430    0.03  \n",
       "5    16.38   2.20   20.244    0.06  \n",
       "6    20.53   1.50    4.811    0.04  \n",
       "7    22.99   1.65    3.404    0.01  \n",
       "8    22.96   2.60    4.250    0.06  \n",
       "9    22.99   1.60    5.236    0.03  \n",
       "10   17.87   3.50   10.706    0.07  \n",
       "11   22.99   1.70    7.244    0.05  \n",
       "12   17.96   1.25   12.195    0.03  \n",
       "13   22.99   1.80   16.787    0.05  \n",
       "14   11.21  12.00   21.680    0.16  \n",
       "15   25.61   8.20    0.000    0.12  \n",
       "16   19.50   1.70    6.046    0.02  \n",
       "17   22.99   6.50   54.615    0.09  \n",
       "18   19.56   3.40    3.823    0.07  \n",
       "19   17.09  41.30  267.960    0.34  \n",
       "20   22.99   1.20    8.028    0.04  \n",
       "21   21.45   2.10    2.956    0.04  \n",
       "22   17.29   1.10    4.435    0.03  \n",
       "23   20.03   0.90    2.372    0.03  \n",
       "24   22.99   1.20   12.031    0.04  \n",
       "25   18.00   1.80    7.002    0.05  \n",
       "26   22.99   1.95    4.582    0.02  \n",
       "27   22.99   3.10   22.507    0.06  \n",
       "28   22.88   1.20    6.170    0.04  \n",
       "29   22.99   2.20    8.393    0.04  \n",
       "..     ...    ...      ...     ...  \n",
       "628  22.98   1.80    6.295    0.03  \n",
       "629  22.46   1.50    3.378    0.02  \n",
       "630  10.17   5.90    9.718    0.10  \n",
       "631  22.97   2.90    5.015    0.07  \n",
       "632  22.96   0.90    1.454    0.03  \n",
       "633  22.99   1.20    6.124    0.05  \n",
       "634  22.98   1.00    3.038    0.03  \n",
       "635  22.98   1.00    2.118    0.03  \n",
       "636  22.98   0.85    2.376    0.03  \n",
       "637  22.97   1.30    3.889    0.04  \n",
       "638  22.98   1.40    2.219    0.02  \n",
       "639  22.69   2.00    4.492    0.02  \n",
       "640  22.99   2.00    2.342    0.02  \n",
       "641  22.98   2.00    3.334    0.02  \n",
       "642  22.99   1.70    8.665    0.06  \n",
       "643  21.97   1.00    9.255    0.03  \n",
       "644  16.41   1.00    5.815    0.03  \n",
       "645  22.99   0.80    3.427    0.03  \n",
       "646  22.25   3.70    9.537    0.06  \n",
       "647   6.08  15.00   42.450    0.22  \n",
       "648  22.99   1.20    2.314    0.03  \n",
       "649  22.86   9.00   14.400    0.15  \n",
       "650  18.30   1.00    1.720    0.03  \n",
       "651  22.98   1.45    2.764    0.02  \n",
       "652  22.98   1.75    2.091    0.02  \n",
       "653  22.98   1.20    6.174    0.05  \n",
       "654  22.98  14.00   41.656    0.22  \n",
       "655  14.67   2.90    7.028    0.08  \n",
       "656  22.98   2.00    2.672    0.02  \n",
       "657  22.98   3.10    5.140    0.05  \n",
       "\n",
       "[658 rows x 12 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.new_stocks()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 融资融券（沪市）\n",
    "\n",
    "沪市的融资融券数据从上海证券交易所网站直接获取，提供了有记录以来的全部汇总和明细数据。根据上交所网站提示：数据根据券商申报的数据汇总，由券商保证数据的真实、完整、准确。\n",
    "\n",
    "    本日融资融券余额＝本日融资余额＋本日融券余量金额\n",
    "    本日融资余额＝前日融资余额＋本日融资买入额－本日融资偿还额；\n",
    "    本日融资偿还额＝本日直接还款额＋本日卖券还款额＋本日融资强制平仓额＋本日融资正权益调整－本日融资负权益调整；\n",
    "    本日融券余量=前日融券余量+本日融券卖出数量-本日融券偿还量；\n",
    "    本日融券偿还量＝本日买券还券量＋本日直接还券量＋本日融券强制平仓量＋本日融券正权益调整－本日融券负权益调整－本日余券应划转量；\n",
    "    融券单位：股（标的证券为股票）/份（标的证券为基金）/手（标的证券为债券）。\n",
    "    明细信息中仅包含当前融资融券标的证券的相关数据，汇总信息中包含被调出标的证券范围的证券的余额余量相关数据。\n",
    "\n",
    "沪市融资融券汇总数据\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    start:开始日期 format：YYYY-MM-DD 为空时取去年今日\n",
    "    end:结束日期 format：YYYY-MM-DD 为空时取当前日期\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    opDate:信用交易日期\n",
    "    rzye:本日融资余额(元)\n",
    "    rzmre: 本日融资买入额(元)\n",
    "    rqyl: 本日融券余量\n",
    "    rqylje: 本日融券余量金额(元)\n",
    "    rqmcl: 本日融券卖出量\n",
    "    rzrqjyzl:本日融资融券余额(元)\n",
    "\n",
    "调用方法：\n",
    "\n",
    "import tushare as ts\n",
    "\n",
    "ts.sh_margins(start='2015-01-01', end='2015-04-19')\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 沪市融资融券明细数据\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    date:日期 format：YYYY-MM-DD 默认为空’‘,数据返回最近交易日明细数据\n",
    "    symbol：标的代码，6位数字e.g.600848，默认为空’‘\n",
    "    start:开始日期 format：YYYY-MM-DD 默认为空’‘\n",
    "    end:结束日期 format：YYYY-MM-DD 默认为空’‘\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    opDate:信用交易日期\n",
    "    stockCode:标的证券代码\n",
    "    securityAbbr:标的证券简称\n",
    "    rzye:本日融资余额(元)\n",
    "    rzmre: 本日融资买入额(元)\n",
    "    rzche:本日融资偿还额(元)\n",
    "    rqyl: 本日融券余量\n",
    "    rqmcl: 本日融券卖出量\n",
    "    rqchl: 本日融券偿还量\n",
    "\n",
    "调用方法：\n",
    "\n",
    "import tushare as ts\n",
    "\n",
    "ts.sh_margin_details(start='2015-01-01', end='2015-04-19', symbol='601989')\n",
    "#如果不设symbol参数或者开始和结束日期时段设置过长，数据获取可能会比较慢，建议分段分步获取，比如一年为一个周期\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 融资融券（深市）\n",
    "\n",
    "深市的融资融券数据从深圳证券交易所网站直接获取，提供了有记录以来的全部汇总和明细数据。在深交所的网站上，对于融资融券的说明如下：\n",
    "\n",
    "说明：\n",
    "\n",
    "本报表基于证券公司报送的融资融券余额数据汇总生成，其中：\n",
    "\n",
    "本日融资余额(元)=前日融资余额＋本日融资买入-本日融资偿还额\n",
    "本日融券余量(股)=前日融券余量＋本日融券卖出量-本日融券买入量-本日现券偿还量\n",
    "本日融券余额(元)=本日融券余量×本日收盘价\n",
    "本日融资融券余额(元)=本日融资余额＋本日融券余额；\n",
    "\n",
    "2014年9月22日起，“融资融券交易总量”数据包含调出标的证券名单的证券的融资融券余额。\n",
    "\n",
    "深市融资融券汇总数据\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    start:开始日期 format：YYYY-MM-DD 为空时取去年今日\n",
    "    end:结束日期 format：YYYY-MM-DD 为空时取当前日期\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    opDate:信用交易日期(index)\n",
    "    rzmre: 融资买入额(元)\n",
    "    rzye:融资余额(元)\n",
    "    rqmcl: 融券卖出量\n",
    "    rqyl: 融券余量\n",
    "    rqye: 融券余量(元)\n",
    "    rzrqye:融资融券余额(元)\n",
    "\n",
    "调用方法：\n",
    "\n",
    "import tushare as ts\n",
    "\n",
    "ts.sz_margins(start='2015-01-01', end='2015-04-19')\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 深市融资融券明细数据\n",
    "\n",
    "参数说明：\n",
    "\n",
    "    date:日期 format：YYYY-MM-DD 默认为空’‘,数据返回最近交易日明细数据\n",
    "    retry_count：当网络异常后重试次数，默认为3\n",
    "    pause:重试时停顿秒数，默认为0\n",
    "\n",
    "返回值说明：\n",
    "\n",
    "    stockCode:标的证券代码\n",
    "    securityAbbr:标的证券简称\n",
    "    rzmre: 融资买入额(元)\n",
    "    rzye:融资余额(元)\n",
    "    rqmcl: 融券卖出量\n",
    "    rqyl: 融券余量\n",
    "    rqye: 融券余量(元)\n",
    "    rzrqye:融资融券余额(元)\n",
    "    opDate:信用交易日期\n",
    "\n",
    "调用方法：\n",
    "\n",
    "import tushare as ts\n",
    "\n",
    "ts.sz_margin_details('2015-04-20')\n",
    "#深市融资融券明细一次只能获取一天的明细数据，如果不输入参数，则为最近一个交易日的明细数据\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
